//============================================================================
// Name        : gpioKlasse.cpp
// Author      : O.M.A.V.
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <iostream>
#include "gpioAansturen.h"

#define LEDHIGH_1  	gpio->portHigh(7);
#define LEDLOW_1	gpio->portLow(7);
#define LEDHIGH_2  	gpio->portHigh(6);
#define LEDLOW_2	gpio->portLow(6);
#define LEDHIGH_3 	gpio->portHigh(5);
#define LEDLOW_3	gpio->portLow(5);
#define LEDHIGH_4  	gpio->portHigh(2);
#define LEDLOW_4	gpio->portLow(2);

using namespace std;

gpioAansturen *gpio;


int main() {

	gpio = new gpioAansturen();

	gpio->installOutput(7);
	gpio->installOutput(6);
	gpio->installOutput(5);
	gpio->installOutput(2);
	while(true)
	{
		printf("LED1 \n\r ");
		LEDHIGH_1;
		sleep(2);
		printf("LED2 \n\r ");
		LEDHIGH_2;
		sleep(2);
		printf("LED3 \n\r ");
		LEDHIGH_3;
		sleep(2);
		printf("LED4 \n\r ");
		LEDHIGH_4;
		sleep(2);

		printf("alles uit \n\r ");
		LEDLOW_1;
		LEDLOW_2;
		LEDLOW_3;
		LEDLOW_4;
		sleep(2);

		printf("alles aan \n\r ");
		LEDHIGH_1;
		LEDHIGH_2;
		LEDHIGH_3;
		LEDHIGH_4;
		sleep(2);

		printf("alles uit \n\r ");
		LEDLOW_1;
		LEDLOW_2;
		LEDLOW_3;
		LEDLOW_4;
		sleep(2);
	}
	return 0;
}
